#pragma once

namespace Base { namespace CmdFwk {

    class InteractiveCmd;

}}

namespace Base { namespace Env {

    class EnvMgr;

    class Environment
    {
        friend class EnvMgr;

    protected:
        Environment(const void* id, 
                    const std::wstring& title,
                    const void* defaultCmd = 0);
        virtual ~Environment();
        
    public:
        const std::wstring& title() const;
        
        // The current interactive command.
        void cmd(const void* cmdId);
        const void* cmd() const;
        
        // Default command.
        const void* defaultCmd() const;
        
        // The type ID. 
        // Note: there is only an environment instance to a kind of environment.
        const void* id() const;

        enum EState
        {
            eNormal = 0,
            eActive,

            // === Bottom ===
            eNumStates,
        };

        EState state() const;
        void state(EState);

    protected:
        virtual void onActivate();
        virtual void onDeactivate();
        
    private:
        EState                  m_state;
        const void*             m_id;
        const std::wstring      m_title;
        const void*             m_cmdId;
        const void*             m_defaultCmdId;
    };

}}